package com.yesjpt.web;

import com.alibaba.fastjson2.JSONObject;
import com.yesjpt.domain.User;
import com.yesjpt.serv.EnvServ;
import com.yesjpt.util.L;
import com.yesjpt.util.MailUtil;
import com.yesjpt.util.SpringUtil;
import com.yesjpt.util.WebSocketServer;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/") // 上下文路径
public class IndexController {
    //http://localhost:8081/hello
    @GetMapping("") ///index.html、/都可以
    public Object index() {
        L.begin(new Throwable().getStackTrace()[0]);
        JSONObject o = new JSONObject();
        o.put("success", true);
        o.put("message", "这是一个数据接口，不是一个页面");
        return o;
    }
	@GetMapping("/hello")
	public Object hello() {
		L.begin(new Throwable().getStackTrace()[0]);
        JSONObject o = new JSONObject();
        o.put("success", true);
        o.put("age", 55);
        o.put("年龄", "55周岁");
        o.put("message", "这是一个Hello数据接口");
        return o;
	}
}
